﻿package com.singlenotion.utils
{
	dynamic public class ExtendedArray extends Array
	{
		public function ExtendedArray(... optionalArgs)
		{
			for each (var value:* in optionalArgs)
			{
				super.push(value);
			}
		}
		
		public function shuffle():void
		{ 
			var arr2:Array = [];
			while (this.length > 0) {
				arr2.push(this.splice(Math.round(Math.random() * (this.length - 1)), 1)[0]);
			}
			
			for each (var val:* in arr2) {
				this.push(val);
			}
		}
	}
}